<?php
class modules_default_forms_RegistrationForm extends forms_FormBase
{
	/**
	 * Init
	 * @see Zend/Zend_Form#init()
	 */
	public function init()
	{
		$oEmailElement = new Zend_Form_Element_Text('email');
		$oEmailElement = $this->_initDefaultFiltersAndValidators($oEmailElement);
		$oEmailElement->addValidator(new Zend_Validate_EmailAddress())
		              ->addValidator(new Zend_Validate_Db_NoRecordExists('user', 'email'));
		$this->addElement($oEmailElement);

		$oPasswordElement = new Zend_Form_Element_Password('password');
		$oPasswordElement->setRequired(true);
		$this->addElement($oPasswordElement);

		$oRePasswordElement = new Zend_Form_Element_Password('re_enter_password');
		$oRePasswordElement->addValidator(new Lemar_Validate_EqualInputs('password'));
		$oRePasswordElement->setRequired(true);
		$this->addElement($oRePasswordElement);

		$oFirstNameElement = new Zend_Form_Element_Text('first_name');
		$oFirstNameElement = $this->_initDefaultFiltersAndValidators($oFirstNameElement);
		$this->addElement($oFirstNameElement);

		$oLastNameElement = new Zend_Form_Element_Text('last_name');
		$oLastNameElement = $this->_initDefaultFiltersAndValidators($oLastNameElement);
		$this->addElement($oLastNameElement);
	}
}